//
//  LeSideMenuViewController.h
//  LeSideMenuViewController
//
//  Created by CaiLei on 2/24/14.
//  Copyright (c) 2014 Le123. All rights reserved.
//

#import <UIKit/UIKit.h>
@class LeSideMenuViewController;

/**
 *  Category to easy fetch LeSideMenuViewController
 */
@interface UIViewController (LeSideMenuViewController)
@property (strong, readonly, nonatomic) LeSideMenuViewController *sideMenuViewController;
@property (strong, readonly, nonatomic) LeSideMenuViewController *leSideMenuViewController;
@end

@protocol LeSideMenuVCDelegate <NSObject>
@optional
- (void)leSideMenuVCWillShowMenu:(LeSideMenuViewController *)vc;
- (void)leSideMenuVCDidHideMenu:(LeSideMenuViewController *)vc;

@end

/**
 *  A simpler side menu view controller slice from RESideMenu
 *  However, fixed some issues of RESideMenu
 
 *  1, Left menu only
 *  2, portrait only
 *  3, no menu / content scale supported
 */
@interface LeSideMenuViewController : UIViewController <UIGestureRecognizerDelegate>
@property (assign, readwrite, nonatomic) NSTimeInterval animationDuration;
/**
 *  pan is adding to self.view
 */
@property (assign, readwrite, nonatomic) BOOL bInnerPan;
/**
 *  pan is from outside pan gesture, and hide menu using pan gesture added to content button
 */
@property (assign, readwrite, nonatomic) BOOL bOutterPan;
@property (assign, readwrite, nonatomic) CGFloat menuOffsetX;
@property (assign, readwrite, nonatomic) CGFloat menuBounceX;

@property (strong, readwrite, nonatomic) UIViewController *contentViewController;
@property (strong, readwrite, nonatomic) UIViewController *menuViewController;

@property (nonatomic, weak) id<LeSideMenuVCDelegate>delegate;
@property (nonatomic, assign) BOOL bMenuVisible;

- (id)initWithContentViewController:(UIViewController *)contentViewController menuViewController:(UIViewController *)menuViewController;
- (void)setContentViewController:(UIViewController *)contentViewController animated:(BOOL)animated;
- (void)showMenu;
- (void)hideMenu;
- (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer;
@end
